const WebSocket = require ('ws');

const ws = new WebSocket ('ws://127.0.0.1:3000/ws');

ws.on ('open', function open () {
ws.send ('test');
});